<?php if(isset($PostFlagEnabled) && $PostFlagEnabled && !empty($PostFlagsMarkData)){ ?>
<div class="btn-group">
    <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown"  aria-haspopup="true" aria-expanded="false" title="回复类型或标记">
        回复类型或标记
    </button><input type="hidden" id="threadcreatepostflag" name="threadcreatepostflag" value="" />
    <ul class="dropdown-menu">
        <?php
$_curflagroup = -1;
foreach ($PostFlagsMarkData as $flagroup => &$_FlagsData) {
    if ($_curflagroup == -1) $_curflagroup = $flagroup;
    if ($_curflagroup != $flagroup) {
        echo '<li class="dropdown-divider"></li>'.PHP_EOL;
    }
    foreach ($_FlagsData as $_FlagDataN => &$_FlagDataV) {
        echo "<li class=\"dropdown-item ghx-postflag-{$_FlagDataN}\"  onclick=\"javascript:selectPostFlag(this,'{$_FlagDataN}','threadcreatepostflag');\" data-AdditionClass=\"{$_FlagDataV['AdditionClass']}\" data-Group=\"{$_FlagDataV['Group']}\" data-Unique=\"{$_FlagDataV['Unique']}\" title=\"{$_FlagDataV['info']}\">{$_FlagDataV['title']}</li>".PHP_EOL;
    }
    $_curflagroup = $flagroup;
}
echo '<li class="dropdown-divider"></li>'.PHP_EOL;
echo "<li class=\"dropdown-item ghx-postflag-clear\"  onclick=\"javascript:selectPostFlag(this,'','threadcreatepostflag');\" title=\"取消选择\">取消</li>".PHP_EOL;
unset($_curflagroup, $_FlagsData, $_FlagDataV, $flagroup, $_FlagsData);
        ?>
    </ul>
</div>
<?php } ?>